let fs = require("fs");
var timea=new Date().getTime();

for(let i=1;i<=1000;i++){

    fs.writeFileSync("./a1/"+i+".txt","aa")

}

var timeb=new Date().getTime();

console.log("异步共花费"+(timeb-timea)+"毫秒");

var timec=new Date().getTime();

for(let i=1;i<=1000;i++){

    fs.writeFile("./a2/"+i+".txt","aa",function(err){})


}

var timed=new Date().getTime();

console.log("异步共花费"+(timed-timec)+"毫秒");